package com.foreverwin.mes.warehouse.strategy;

/**
 * @author Ervin Chen
 * @date 2020/2/10 13:55
 */
public enum InventoryReceiveStrategyFactory {

    /**物料库存需要拆分*/
    Y(new InventoryReceiveSplitStrategy()),
    /**物料库存不需要拆分*/
    N(new InventoryReceiveNotSplitStrategy());

    private InventoryReceiveStrategy inventoryReceiveStrategy;

    InventoryReceiveStrategyFactory(InventoryReceiveStrategy inventoryReceiveStrategy) {
        this.inventoryReceiveStrategy = inventoryReceiveStrategy;
    }

    public static InventoryReceiveStrategy getInventoryReceiveStrategy( String mode ) {
        return valueOf(mode).inventoryReceiveStrategy;
    }
}
